package com.songcha.module_bookreader.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.songcha.library_common.util.JumpUtil;
import com.songcha.module_bookreader.R;
import com.songcha.module_bookreader.ui.activity.reader.BookReadActivity;
import com.songcha.library_business.bean.book.BookBean;
import com.songcha.module_bookreader.ui.activity.sdcard_novel_select.SDCardNovelSelectActivity;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bookreader_activity_main);

        toBookReader();

        (findViewById(R.id.bookreader_btn)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                toBookReader();
            }
        });
    }

    private void toBookReader(){
        toBokReaderById();
        //toSDCardNovelSelect();
    }

    private void toBokReaderById(){
        BookBean book = new BookBean();
        book.setId("4539");
        book.setBookName("111");
        book.setFromSDCard(false);
        Intent intent = new Intent(MainActivity.this, BookReadActivity.class);
        intent.putExtra("book",book);
        startActivity(intent);
    }

    private void toSDCardNovelSelect(){
        JumpUtil.toActivity(this,SDCardNovelSelectActivity.class);
    }

}
